import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from "vue-router"
// 2. 配置路由
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Home/index.vue")
  },
  {
    path: "/Risk",
    name: "Risk",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Risk/index.vue")
  },
  {
    path: "/addRisk",
    name: "AddRisk",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Risk/addRisk.vue")
  },
  {
    path: "/riskDetail/:id",
    name: "RiskDetail",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Risk/editRisk.vue")
  },
  {
    path: "/employee",
    name: "Employee",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Employee/index.vue")
  },
  {
    path: "/EditEmployee/:id",
    name: "EditEmployee",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Employee/EditEmployee.vue")
  },
  {
    path: "/Train",
    name: "Train",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/Train/index.vue")
  },
  {
    path: "/ReportForms",
    name: "ReportForms",
    component: () => import(/* webpackChunkName: "recorder" */ "../pages/ReportForms/index.vue")
  }
]
// 1.返回一个 router 实列，为函数，里面有配置项（对象） history
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

// 3导出路由   然后去 main.ts 注册 router.ts
export default router
